// 定义品牌管理api类型接口
import { ResponseData } from '../type.ts';

export interface TrademarkListReqData {
  page: number;
  limit: number;
}
export type Trademark = {
  id?: number;
  createTime?: string;
  updateTime?: string;
  tmName: string;
  logoUrl: string;
};
type TrademarkList = {
  records: Trademark[];
  total: number;
  size: number;
  current: number;
  orders: any[];
  optimizeCountSql: boolean;
  hitCount: boolean;
  countId: null;
  maxLimit: null;
  searchCount: boolean;
  pages: number;
};
//替换ResponseData中的data属性
export interface TrademarkListResData extends ResponseData {
  data: TrademarkList;
}

// 定义商品分类相关接口类型
export interface Category1 {
  id: number;
  name: string;
  createTime: string;
  updateTime: string;
}
export interface Category2 extends Category1 {
  category1Id: number;
}
export interface Category3 extends Category1 {
  category2Id: number;
}
export interface Category1ResData extends ResponseData {
  data: Category1[];
}
export interface Category2ResData extends ResponseData {
  data: Category2[];
}
export interface Category3ResData extends ResponseData {
  data: Category3[];
}

// 属性相关接口类型
export interface Category {
  category1Id: number;
  category2Id: number;
  category3Id: number;
}
export interface AttrValue {
  id?: number;
  attrId?: number;
  valueName: string;
  createTime?: string;
  updateTime?: string;
}
export interface AttrInfo {
  id?: number;
  attrName: string;
  attrValueList: AttrValue[];
  categoryId: number;
  categoryLevel: number;
  createTime?: string;
  updateTime?: string;
}
export interface AttrInfoListResData extends ResponseData {
  data: AttrInfo[];
}

// Spu相关接口类型
export interface SpuListReqData {
  page: number;
  limit: number;
  category3Id: number;
}
// spu图片列表
export interface SpuImage {
  id?: number;
  spuId?: number;
  imgUrl: string;
  imgName: string;
  createTime?: string;
  updateTime?: string;
}
export interface SpuImageListResData extends ResponseData {
  data: SpuImage[];
}
// spu销售属性值
export interface SpuSaleAttrValue {
  baseSaleAttrId: number;
  id?: number;
  isChecked?: boolean;
  saleAttrName: string;
  saleAttrValueName: string;
  spuId?: number;
  createTime?: string;
  updateTime?: string;
}
// spu销售属性
export interface SpuSaleAttr {
  id?: number;
  baseSaleAttrId: number;
  saleAttrName: string;
  spuId?: number;
  spuSaleAttrValueList: SpuSaleAttrValue[];
  createTime?: string;
  updateTime?: string;
}
export interface SpuSaleAttrListResData extends ResponseData {
  data: SpuSaleAttr[];
}
// spu信息
export interface SpuInfo {
  category3Id: number;
  id?: number;
  createTime?: string;
  updateTime?: string;
  description: string;
  spuImageList: SpuImage[];
  spuName: string;
  spuPosterList?: SpuImage[];
  spuSaleAttrList: SpuSaleAttr[];
  tmId: number | null;
}
export interface SpuInfoResData extends ResponseData {
  data: SpuInfo;
}
// spu列表数据
interface SpuListData {
  current: number;
  pages: number;
  hitCount: boolean;
  searchCount: boolean;
  total: number;
  size: number;
  records: SpuInfo[];
}
export interface SpuListResData extends ResponseData {
  data: SpuListData;
}
// 全部品牌列表数据
export interface AllTrademarkResData extends ResponseData {
  data: Trademark[];
}
// 基础销售属性
export interface BaseSaleAttr {
  id: number;
  name: string;
  createTime: string;
  updateTime: string;
}
export interface BaseSaleAttrListResData extends ResponseData {
  data: BaseSaleAttr[];
}
// skuAttrValue
export interface SkuAttrValue {
  id?: number;
  attrId: number;
  attrName?: string;
  valueId: number | null;
  valueName?: string;
  skuId?: number;
  createTime?: string;
  updateTime?: string;
}
// SkuSaleAttrValue
export interface SkuSaleAttrValue {
  id?: number;
  saleAttrId: number;
  saleAttrName: string;
  saleAttrValueId: number | null;
  saleAttrValueName?: string;
  skuId?: number;
  spuId?: number;
  createTime?: string;
  updateTime?: string;
}
// SkuImage
export interface SkuImage {
  id?: number;
  skuId?: number;
  spuImgId: number;
  isDefault: '0' | '1';
  imgUrl: string;
  imgName: string;
  createTime?: string;
  updateTime?: string;
}
// SKU info
export interface SkuInfo {
  id?: number;
  createTime?: string;
  updateTime?: string;
  spuId: number;
  price: number | null;
  skuName: string;
  skuDesc: string;
  weight: string;
  tmId?: number;
  category3Id: number;
  isSale?: 0 | 1;
  skuDefaultImg?: string;
  skuImageList: SkuImage[];
  skuAttrValueList: SkuAttrValue[];
  skuSaleAttrValueList: SkuSaleAttrValue[];
}
export interface SkuListResData extends ResponseData {
  data: SkuInfo[];
}
export interface SkuDetailResData extends ResponseData {
  data: SkuInfo;
}
interface SkuList {
  records: SkuInfo[];
  total: number;
  size: number;
  current: number;
  orders: any[];
  optimizeCountSql: boolean;
  hitCount: boolean;
  countId: null;
  maxLimit: null;
  searchCount: boolean;
  pages: number;
}
export interface SkuAllListResData extends ResponseData {
  data: SkuList;
}
